<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<title>后台管理系统 </title>
		<%- include ("../backstage/backPublic.ejs")%>
		<link rel="stylesheet" type="text/css" href="/css/backstage/backIndex.css">
	</head>
	<body>
		<div class="right">
			<table class="table table-bordered">
				<tbody>
					<tr>
						<td>
							<form class="navbar-form navbar-left" role="search">
								<div class="form-group">
									<input type="text" class="form-control" placeholder="搜索">
								</div>
								<button type="submit" class="btn btn-primary">查询</button>
							</form>
						</td>
					</tr>
				</tbody>
			</table>
			<table class="table table-bordered  table-hover">
				<thead>
					<tr>
						<th>id</th>
						<th>用户名</th>
						<th>头像</th>
						<th>性别</th>
						<th>手机号</th>
						<th>密码</th>
						<th>关注量</th>
						<th>粉丝量</th>
						<th>获赞量</th>
						<th>个人介绍</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
				<%for(var i=0;i<list.length;i++) { %>
					<tr>
						<td><%=list[i].id%><input type="text" id="id" value="<%=list[i].id%>"></td>

						<td><%=list[i].nickname%></td>
						<td><%=list[i].nickname%></td>
						<td><%=list[i].sex%></td>
						<td><%=list[i].mobliePhone%></td>
						<td><%=list[i].password%></td>
						<td><%=list[i].focusNumber%></td>
						<td><%=list[i].fansNumber%></td>
						<td><%=list[i].likeNumber%></td>
						<td><%=list[i].nickname%></td>
						<td>
							<a href="/backstage/information?userId=<%=list[i].id%>">
								<button type="submit" class="btn btn-success">修改</button>
							</a>
							<a href="/backstage/backIndex?userId=<%=list[i].id%>">
								<button type="submit" class="btn btn-danger" onclick="deleteOne()">删除</button>
							</a>
						</td>
					</tr>
				<% } %>
				</tbody>
			</table>

			<div class="col-sm-9"></div>
			<div class="col-sm-3">
				<ul class="pagination">
					<li class="page-item">
						<a class="page-link" href="3batch.html"><span class="glyphicon glyphicon-chevron-left"></span></a>
					</li>
					<li class="page-item">
						<a class="page-link" href="3batch.html">1</a>
					</li>
					<li class="page-item">
						<a class="page-link" href="3batch_next.html">2</a>
					</li>
					<li class="page-item">
						<a class="page-link" href="#">...</a>
					</li>
					<li class="page-item">
						<a class="page-link" href="3batch_next.html"><span class="glyphicon glyphicon-chevron-right"></span></a>
					</li>
				</ul><br></div>

		</div>


	</body>
	<script src="https://cdn.staticfile.org/jquery/2.0.0/jquery.min.js"></script>
	<script>
		function deleteOne() {
			const id = document.getElementById("id").value;
			alert(id)
			$.ajax({
				type: 'POST',
				url: '/backstage/backIndex/delete',
				data: {
					id:id,
				},
				dataType: 'json',
				success: function (data) {
					alert("成功")
				}
			})
		}

	</script>
</html>
